www.gusucode.com > 深度学习(asp)网址导航 v4.0.1 > 深度学习(asp)网址导航 v4.0.1\code\include\tree_xml_HTML.asp
<% projectRootPath = "../" '相对当前应用程序根的位置 %> <!--#include file="../connDB.asp"--> <% response.ContentType="text/xml" response.write ("<?xml version='1.0' encoding='gb2312' ?>" ) response.write ("<tree> " ) id_Sort=trim(request.QueryString("id") ) if id_Sort="" or (not isNumeric(id_Sort)) then id_Sort=0 end if '网址分类 Set rsWebSort=Server.CreateObject("Adodb.Recordset") sql= "Select * from deep_WebSort where fparentID="&id_Sort&" order by forderID" rsWebSort.open sql,conn,0,1 if rsWebSort.Eof and rsWebSort.Bof then 'Response.Write("<td>暂时没有网址</td></tr>") else While (Not rsWebSort.Eof) ' //tree.add(id,父id,'显示链接名','链接地址'); if(isSub(rsWebSort("fid_Sort"))=true) then response.write (" <tree text='"&rsWebSort("fname")&"' src='../../include/tree_xml_HTML.asp?id="&rsWebSort("fid_Sort")&"' action='sort_"&rsWebSort("fid_Sort")&".htm' /> " ) else response.write (" <tree text='"&rsWebSort("fname")&"' action='sort_"&rsWebSort("fid_Sort")&".htm' /> " ) end if rsWebSort.MoveNext Wend end if rsWebSort.Close Set rsWebSort=Nothing %> <% response.write ("</tree> " ) '┌──────────────────── 深度空间 深度学习 ──┐ '│过程名:isSub(id) '│作 用:检查是否存在子分类 '│参 数:id 父id '│说 明:返回值 true 有子分类 false 无 '│日 期:2007/10/23 '└──────────────────── www.DeepTeach.com ──┘ function isSub(id) Set rsIsSub=Server.CreateObject("Adodb.Recordset") sqlIsSub="Select * from deep_WebSort where fparentID=" & id rsIsSub.open sqlIsSub,conn,0,1 if rsIsSub.Eof and rsIsSub.Bof then isSub=false else isSub=true end if rsIsSub.close Set rsIsSub =Nothing end function %>